回复需要即时服务的投诉单
商户可通过调用此接口,针对需要即时服务的投诉单(need_immediate_service为true)提交内容回复用户。此接口支持使用新版消息格式(NormalMessage),可发送富文本、图片、按钮组等多种消息类型。
| 请求参数 | 类型 | 描述 |
|---|---|---|
| complaint_id | string | 投诉单号 |
| json | object | 声明请求的JSON数据结构 |
| complainted_mchid | string | 被诉商户号 |
| message | object | 消息内容 |
| blocks | object[] | 消息内容 |
| type | string | 消息块类型TEXT | IMAGE | LINK | FAQ_LIST | BUTTON | BUTTON_GROUP 枚举值之一 |
| text | object | 文本 |
| text | string | 文本 |
| color | string | 文本颜色DEFAULT | SECONDARY 枚举值之一 |
| is_bold | boolean | 是否粗体 |
| image | object | 图片 |
| media_id | string | 媒体ID |
| image_style_type | string | 图片样式类型IMAGE_STYLE_TYPE_NARROW | IMAGE_STYLE_TYPE_WIDE 枚举值之一 |
| link | object | 链接 |
| text | string | 文本 |
| action | object | 动作 |
| action_type | string | 动作类型ACTION_TYPE_SEND_MESSAGE | ACTION_TYPE_JUMP_URL | ACTION_TYPE_JUMP_MINI_PROGRAM 枚举值之一 |
| jump_url | string | 跳转链接 |
| mini_program_jump_info | object | 跳转小程序信息 |
| appid | string | 跳转小程序APPID |
| path | string | 跳转小程序页面PATH |
| text | string | 跳转小程序页面名称 |
| message_info | object | 回复消息内容 |
| content | string | 回复的消息内容 |
| custom_data | string | 自定义透传字段 |
| action_id | string | 动作id |
| invalid_info | object | 失效配置 |
| expired_time | string | 过期时间 |
| multi_clickable | boolean | 是否可以多次点击 |
| faq_list | object | FAQ列表 |
| faqs | object[] | FAQ列表 |
| faq_id | string | faq的id |
| faq_title | string | faq内容 |
| action | object | 动作 |
| action_type | string | 动作类型ACTION_TYPE_SEND_MESSAGE | ACTION_TYPE_JUMP_URL | ACTION_TYPE_JUMP_MINI_PROGRAM 枚举值之一 |
| jump_url | string | 跳转链接 |
| mini_program_jump_info | object | 跳转小程序信息 |
| appid | string | 跳转小程序APPID |
| path | string | 跳转小程序页面PATH |
| text | string | 跳转小程序页面名称 |
| message_info | object | 回复消息内容 |
| content | string | 回复的消息内容 |
| custom_data | string | 自定义透传字段 |
| action_id | string | 动作id |
| button | object | 按钮 |
| text | string | 文本 |
| action | object | 动作 |
| action_type | string | 动作类型ACTION_TYPE_SEND_MESSAGE | ACTION_TYPE_JUMP_URL | ACTION_TYPE_JUMP_MINI_PROGRAM 枚举值之一 |
| jump_url | string | 跳转链接 |
| mini_program_jump_info | object | 跳转小程序信息 |
| appid | string | 跳转小程序APPID |
| path | string | 跳转小程序页面PATH |
| text | string | 跳转小程序页面名称 |
| message_info | object | 回复消息内容 |
| content | string | 回复的消息内容 |
| custom_data | string | 自定义透传字段 |
| action_id | string | 动作id |
| invalid_info | object | 失效配置 |
| expired_time | string | 过期时间 |
| multi_clickable | boolean | 是否可以多次点击 |
| button_group | object | 按钮组 |
| buttons | object[] | 按钮组 |
| text | string | 文本 |
| action | object | 动作 |
| action_type | string | 动作类型ACTION_TYPE_SEND_MESSAGE | ACTION_TYPE_JUMP_URL | ACTION_TYPE_JUMP_MINI_PROGRAM 枚举值之一 |
| jump_url | string | 跳转链接 |
| mini_program_jump_info | object | 跳转小程序信息 |
| appid | string | 跳转小程序APPID |
| path | string | 跳转小程序页面PATH |
| text | string | 跳转小程序页面名称 |
| message_info | object | 回复消息内容 |
| content | string | 回复的消息内容 |
| custom_data | string | 自定义透传字段 |
| action_id | string | 动作id |
| invalid_info | object | 失效配置 |
| expired_time | string | 过期时间 |
| multi_clickable | boolean | 是否可以多次点击 |
| button_layout | string | 按钮布局方式LAYOUT_UNKNOWN | LAYOUT_HORIZONTAL | LAYOUT_VERTICAL 枚举值之一 |
| invalid_info | object | 失效配置 |
| expired_time | string | 过期时间 |
| multi_clickable | boolean | 是否可以多次点击 |
| sender_identity | string | 发送者身份类别UNKNOWN | MANUAL | MACHINE 枚举值之一 |
| custom_data | string | 自定义透传信息 |
| idempotent_id | string | 幂等ID |
php
$instance->v3->merchantService->complaintsV2->_complaint_id_->responseImmediateService->postAsync([
'complaint_id' => '200201820200101080076610000',
'json' => [
'complainted_mchid' => '1900012181',
'message' => [
'blocks' => [[
'type' => 'TEXT',
'text' => [
'text' => 'example_text',
'color' => 'DEFAULT',
'is_bold' => true,
],
'image' => [
'media_id' => 'example_media_id',
'image_style_type' => 'IMAGE_STYLE_TYPE_NARROW',
],
'link' => [
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
'faq_list' => [
'faqs' => [[
'faq_id' => 'example_faq_id',
'faq_title' => 'example_faq_title',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
],],
],
'button' => [
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
'button_group' => [
'buttons' => [[
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],],
'button_layout' => 'LAYOUT_HORIZONTAL',
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
],],
'sender_identity' => 'UNKNOWN',
'custom_data' => 'example_custom_data',
],
'idempotent_id' => '550e8400-e29b-41d4-a716-446655440000',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance->chain('v3/merchant-service/complaints-v2/{complaint_id}/response-immediate-service')->postAsync([
'complaint_id' => '200201820200101080076610000',
'json' => [
'complainted_mchid' => '1900012181',
'message' => [
'blocks' => [[
'type' => 'TEXT',
'text' => [
'text' => 'example_text',
'color' => 'DEFAULT',
'is_bold' => true,
],
'image' => [
'media_id' => 'example_media_id',
'image_style_type' => 'IMAGE_STYLE_TYPE_NARROW',
],
'link' => [
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
'faq_list' => [
'faqs' => [[
'faq_id' => 'example_faq_id',
'faq_title' => 'example_faq_title',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
],],
],
'button' => [
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
'button_group' => [
'buttons' => [[
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],],
'button_layout' => 'LAYOUT_HORIZONTAL',
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
],],
'sender_identity' => 'UNKNOWN',
'custom_data' => 'example_custom_data',
],
'idempotent_id' => '550e8400-e29b-41d4-a716-446655440000',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance['v3/merchant-service/complaints-v2/{complaint_id}/response-immediate-service']->postAsync([
'complaint_id' => '200201820200101080076610000',
'json' => [
'complainted_mchid' => '1900012181',
'message' => [
'blocks' => [[
'type' => 'TEXT',
'text' => [
'text' => 'example_text',
'color' => 'DEFAULT',
'is_bold' => true,
],
'image' => [
'media_id' => 'example_media_id',
'image_style_type' => 'IMAGE_STYLE_TYPE_NARROW',
],
'link' => [
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
'faq_list' => [
'faqs' => [[
'faq_id' => 'example_faq_id',
'faq_title' => 'example_faq_title',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
],],
],
'button' => [
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
'button_group' => [
'buttons' => [[
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],],
'button_layout' => 'LAYOUT_HORIZONTAL',
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
],],
'sender_identity' => 'UNKNOWN',
'custom_data' => 'example_custom_data',
],
'idempotent_id' => '550e8400-e29b-41d4-a716-446655440000',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$response = $instance->v3->merchantService->complaintsV2->_complaint_id_->responseImmediateService->post([
'complaint_id' => '200201820200101080076610000',
'json' => [
'complainted_mchid' => '1900012181',
'message' => [
'blocks' => [[
'type' => 'TEXT',
'text' => [
'text' => 'example_text',
'color' => 'DEFAULT',
'is_bold' => true,
],
'image' => [
'media_id' => 'example_media_id',
'image_style_type' => 'IMAGE_STYLE_TYPE_NARROW',
],
'link' => [
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
'faq_list' => [
'faqs' => [[
'faq_id' => 'example_faq_id',
'faq_title' => 'example_faq_title',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
],],
],
'button' => [
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
'button_group' => [
'buttons' => [[
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],],
'button_layout' => 'LAYOUT_HORIZONTAL',
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
],],
'sender_identity' => 'UNKNOWN',
'custom_data' => 'example_custom_data',
],
'idempotent_id' => '550e8400-e29b-41d4-a716-446655440000',
],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance->chain('v3/merchant-service/complaints-v2/{complaint_id}/response-immediate-service')->post([
'complaint_id' => '200201820200101080076610000',
'json' => [
'complainted_mchid' => '1900012181',
'message' => [
'blocks' => [[
'type' => 'TEXT',
'text' => [
'text' => 'example_text',
'color' => 'DEFAULT',
'is_bold' => true,
],
'image' => [
'media_id' => 'example_media_id',
'image_style_type' => 'IMAGE_STYLE_TYPE_NARROW',
],
'link' => [
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
'faq_list' => [
'faqs' => [[
'faq_id' => 'example_faq_id',
'faq_title' => 'example_faq_title',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
],],
],
'button' => [
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
'button_group' => [
'buttons' => [[
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],],
'button_layout' => 'LAYOUT_HORIZONTAL',
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
],],
'sender_identity' => 'UNKNOWN',
'custom_data' => 'example_custom_data',
],
'idempotent_id' => '550e8400-e29b-41d4-a716-446655440000',
],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance['v3/merchant-service/complaints-v2/{complaint_id}/response-immediate-service']->post([
'complaint_id' => '200201820200101080076610000',
'json' => [
'complainted_mchid' => '1900012181',
'message' => [
'blocks' => [[
'type' => 'TEXT',
'text' => [
'text' => 'example_text',
'color' => 'DEFAULT',
'is_bold' => true,
],
'image' => [
'media_id' => 'example_media_id',
'image_style_type' => 'IMAGE_STYLE_TYPE_NARROW',
],
'link' => [
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
'faq_list' => [
'faqs' => [[
'faq_id' => 'example_faq_id',
'faq_title' => 'example_faq_title',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
],],
],
'button' => [
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
'button_group' => [
'buttons' => [[
'text' => 'example_text',
'action' => [
'action_type' => 'ACTION_TYPE_SEND_MESSAGE',
'jump_url' => 'example_jump_url',
'mini_program_jump_info' => [
'appid' => 'example_appid',
'path' => 'example_path',
'text' => 'example_text',
],
'message_info' => [
'content' => 'example_content',
'custom_data' => 'example_custom_data',
],
'action_id' => 'example_action_id',
],
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],],
'button_layout' => 'LAYOUT_HORIZONTAL',
'invalid_info' => [
'expired_time' => '2015-05-20T13:29:35+08:00',
'multi_clickable' => true,
],
],
],],
'sender_identity' => 'UNKNOWN',
'custom_data' => 'example_custom_data',
],
'idempotent_id' => '550e8400-e29b-41d4-a716-446655440000',
],
]);
print_r(json_decode((string) $response->getBody(), true));| 返回字典 | 类型 | 描述 |
|---|---|---|
| log_id | string | 操作流水号 |